﻿CREATE TABLE [dbo].[tblRefund] (
    [RefundID]      INT           IDENTITY (1, 1) NOT NULL,
    [OrderID]       INT           NOT NULL,
    [Cost]          MONEY         NULL,
	[MaxCost]		money	null,
    [RefundDate]    DATETIME      NULL,
    [ImportDate]    DATETIME      NULL,
    [DepositDate]   SMALLDATETIME NULL,
    [TransactionID] INT           NULL,
    [RefundTypeID]  INT           NULL,
    [UserID]        INT           NULL,
    [OrderDetailID] INT           NULL,
	[OrderTaxID]	int	null
);


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Defines a single refund on all items except Omega clubs.', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'tblRefund';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'The Refund ID', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'tblRefund', @level2type = N'COLUMN', @level2name = N'RefundID';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'The OrderID this return is tied to', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'tblRefund', @level2type = N'COLUMN', @level2name = N'OrderID';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'The amount being refunded', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'tblRefund', @level2type = N'COLUMN', @level2name = N'Cost';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Date the refund is processed', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'tblRefund', @level2type = N'COLUMN', @level2name = N'RefundDate';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Date the record was loaded into this table', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'tblRefund', @level2type = N'COLUMN', @level2name = N'ImportDate';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'Date the refund amount is depositted', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'tblRefund', @level2type = N'COLUMN', @level2name = N'DepositDate';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'The transaction ID.  Links to tblTransaction', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'tblRefund', @level2type = N'COLUMN', @level2name = N'TransactionID';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'The refund type ID.  See codeRefundType', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'tblRefund', @level2type = N'COLUMN', @level2name = N'RefundTypeID';


GO
EXECUTE sp_addextendedproperty @name = N'MS_Description', @value = N'The user who processed the refund', @level0type = N'SCHEMA', @level0name = N'dbo', @level1type = N'TABLE', @level1name = N'tblRefund', @level2type = N'COLUMN', @level2name = N'UserID';


